<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

use Magento\Paypal\Block\Express\InContext\Minicart\Button;

/**
 * @var \Magento\Paypal\Block\Express\InContext\Minicart\Button $block
 */
$config = [
    'Magento_Paypal/js/in-context/button' => [
        'id' => $block->escapeHtml($block->getContainerId()),
        'linkDataAction' => $block->escapeHtml($block->getLinkAction()),
        'paypalButton' => $block->escapeHtml(Button::PAYPAL_BUTTON_ID),
        'addToCartSelector' => $block->escapeHtml($block->getAddToCartSelector())
    ]
];

?>
<div data-mage-init='<?php /* @noEscape */ echo json_encode($config); ?>'
     class="paypal checkout paypal-logo <?php echo $block->escapeHtml($block->getContainerId()); ?>-container">
    <a data-action="<?php echo $block->escapeHtml($block->getLinkAction()); ?>" href="#">
        <img class="paypal-button-hidden"
             src="<?php echo $block->escapeHtml($block->getImageUrl()); ?>"
             alt="Check out with PayPal" />
    </a>
</div>
